﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Web.Mvc;
using DAL;
using SimpComm;

namespace ViewModel
{
    [DataContract]
    public class UserListModel
    {
        [DataMember]
        [Display(Name = "姓名")]
        public string Name { get; set; }

        [IgnoreDataMember]
        public byte Type { get; set; }

        [DataMember]
        [Display(Name = "企业状态")]
        public string RoleTxt
        {
            get { return DAL.Enums.emUser_State.Get(Type).Text; }
            set
            {
                byte type = 1;
                Type = DAL.Enums.emUser_State.Get(type).Value;
            }
        }

        [DataMember]
        [Display(Name = "ID")]
        public int ID { get; set; }
    }

    public class UserDetailInfoModel
    {
        public string Name { get; set; }
        public byte Type { get; set; }
    }

    public class UserLogOnModel
    {
        [Required(ErrorMessage = "请输入用户名/邮箱")]
        [Display(Name = "用户名")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "请输入密码")]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [Display(Name = "是否自动登录?")]
        public bool RememberMe { get; set; }
    }

    public class UserCreateModel
    {
        [Required]
        [Display(Name = "用户名")]
        public string LoginID { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "{0}必须至少大于{2}个字符的的长度..", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string LoginPwd { get; set; }

        [Required]
        [Display(Name = "姓名")]
        public string Name { get; set; }

        [Display(Name = "邮箱")]
        public string Security_Email { get; set; }

    }

    public class UserEditModel
    {

        public int ID { get; set; }

        [Display(Name = "姓名")]
        public string Name { get; set; }

        [Display(Name = "联系方式")]
        public string LivePhone { get; set; }

    }

    public class UserEditColsModel
    {
        /// <summary>
        /// ID
        /// </summary>
        public int ID { get; set; }

        [Display(Name = "权限字符串")]
        public string RRole { get; set; }
    }
}
